<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改用户操作')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-consumerInfo-edit" th:object="${consumerInfo}">
            <input name="consumerId" th:field="*{consumerId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">账号：</label>
                <div class="col-sm-8">
                    <input name="loginName" th:field="*{loginName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">密码：</label>
                <div class="col-sm-8">
                    <input name="loginPwd" th:field="*{loginPwd}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">性别：</label>
                <div class="col-sm-8">
                    <select name="userSex" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户名称：</label>
                <div class="col-sm-8">
                    <input name="userName" th:field="*{userName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">真实姓名：</label>
                <div class="col-sm-8">
                    <input name="trueName" th:field="*{trueName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生日：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="brithday" th:value="${#dates.format(consumerInfo.brithday, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户头像：</label>
                <div class="col-sm-8">
                    <input name="userPhoto" th:field="*{userPhoto}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户qq号：</label>
                <div class="col-sm-8">
                    <input name="userQqNum" th:field="*{userQqNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">手机号码：</label>
                <div class="col-sm-8">
                    <input name="phoneNumber" th:field="*{phoneNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户邮箱：</label>
                <div class="col-sm-8">
                    <input name="userEmail" th:field="*{userEmail}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">邀请码：</label>
                <div class="col-sm-8">
                    <input name="inCode" th:field="*{inCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">推广二维码地址：</label>
                <div class="col-sm-8">
                    <input name="saleQrCode" th:field="*{saleQrCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">账号状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'userStatus_' + dict.dictCode}" name="userStatus" th:value="${dict.dictValue}" th:field="*{userStatus}">
                        <label th:for="${'userStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "consumer/consumerInfo";
        $("#form-consumerInfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-consumerInfo-edit').serialize());
            }
        }

        $("input[name='brithday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>